<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./vue.js"></script>
  <script src="./vuex.js"></script>
</head>
<div id="app">
  <p>{{name}}</p>
</div>

<script>
  const mapState = Vuex.mapState;

  const store = new Vuex.Store({
    state: {
      name: "mapState辅助函数生成state"
    }
  })

  const vm = new Vue({
    el: "#app",
    store,
    // computed: mapState({
    //   // name: (state) => {
    //   //   return state.name
    //   // }
    //   name: state => state.name
    //   // name: "name"
    // })
    computed: mapState({
      name: state => state.name
    })
  })
</script>

<body>

</body>

</html>